import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: '/user/register',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/user/current-user-detail',
    method: 'get',
  })
}

export function getList(params) {
  return request({
    url: '/user/list',
    method: 'get',
    params
  })
}

export function getLoginInfo(id) {
  return request({
    url: '/user/user-login-info/'+id,
    method: 'get',
  })
}

export function getListInfo(id) {
  return request({
    url: '/user/list-user-detail/'+id,
    method: 'get',
  })
}

export function getAllUserList() {
  return request({
    url: '/user/allList',
    method: 'get',
  })
}

export function editUser(data) {
  return request({
    url: '/user/edit',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/deleteUser',
    method: 'post',
    data
  })
}

export function getListByDept(deptId) {
  return request({
    url: '/user/dept-userList/'+deptId,
    method: 'get',
  })
}